<?php if($_SESSION['config_template']=='layoutmain_web1') { ?>
<!-- [start] .latest news-sidebar // -->
<div style="clear:both;"></div>
<div class="top_box"><span></span></div>

<div class="box base-mini mini-cart">
	<div class="head">
		<h4><?php echo $title;?>
		
		<div style="float: right;margin-right:10px; margin-top:0px;">
		<!-- T?o cây bút chì cho click and change -->
		<?php if(isset($login)&& $login =="1" && isset($permission) && $permission=="true")  {?>
		<ul class="gallery clearfix">
			<a href="/lastestnews/clickchange?iframe=true&width=370&height=320" rel="prettyPhoto[iframe]">
				<img src="/images/Pencil.png" style="width:20px ; height:20px; margin-top:-4px"></img>
			</a>
		</ul>
		<?php  }?>
		<!-- End - T?o cây bút chì cho click and change -->
		</div>
		
		</h4>
	</div>
	<div class="middle_box">
	
	<div class="content" style="height:auto;">

		<div class="new_detail" >
				<?php foreach ($AllNews as $News){ ?>
				<div style="float:left;">
				<a href="/news/detail?id=<?php echo $News["thing_id"] ?>"><img width="55px" height="45px" src="<?php if($News['avatar'] != null){echo $News['avatar'];}else{echo "/images/img_thumb.gif";}?>" onerror="this.src='images/img_thumb.gif'">
				</a>
				</div>
				<div style="margin-left:58px;">
					<a href="/news/detail?id=<?php echo $News["thing_id"] ?>" style="font-size: 11px;">
						<?php 
						$kt=strlen($News['title']);
						if ($kt<=35)  
							echo $News['title']; 
						else 
							echo substr($News['title'], 0,35)."..";
						?>
					</a>
					<br>
					<div style="color:rgb(150,150,150); float:right;text-decoration:none;font-size: 11px;"><?php echo $textviews ?> <?php echo $News['views']?> </div>                                                                       
				</div>
				<div style="clear:both;"></div>
				<br>
				<?php }?>
		</div>
	</div>

	</div>
	<div class="bottom_box"><span></span></div>
</div>

<!-- [ends] .latest-sidebar // -->

<?php } else if($_SESSION['config_template']=='layoutmain_web2') { ?>
	<div class="top_box"><span></span></div>

<div class="box currency-switcher">
	<div class="head">
		<h4><?php echo $title;?>
		<?php if(isset($login)&& $login =="1" && isset($permission) && $permission=="true")  {?>
		<div style="float: right;margin-right:10px; margin-top:0px;">
		<!-- T?o cây bút chì cho click and change -->
		<ul class="gallery clearfix">
			<a href="/lastestnews/clickchange?iframe=true&width=370&height=320" rel="prettyPhoto[iframe]">
				<img src="/images/Pencil.png" style="width:20px ; height:20px; margin-top:-4px"></img>
			</a>
		</ul>
		<!-- End - T?o cây bút chì cho click and change -->
		</div>
		<?php  }?>
		</h4>
	</div>
	<div class="content_current">
		<link rel="stylesheet" type="text/css" href="/css/web2/mostviewnews.css" />
		<div class="most_view_content" style="margin-top:0px; padding: 0px">
				
					<?php foreach ($AllNews as $News){ ?>
					<div class="most_view_item" align="center">
						<a href="/news/detail?id=<?php echo $News["thing_id"] ?>">
							<div class="image" align="center" style="height:45px;width:55px;float:left">
								<img width="55px" height="45px" src="<?php if($News['avatar'] != null){echo $News['avatar'];}else{echo "/images/img_thumb.gif";}?>" onerror="this.src='images/img_thumb.gif'">
							</div>
						</a>
						<div class="new">
							<a href="/news/detail?id=<?php echo $News["thing_id"] ?>" style="font-size: 11px;">
								<?php 
								$kt=strlen($News['title']);
								if ($kt<=35)  
									echo $News['title']; 
								else 
									echo substr($News['title'], 0,35)."..";
								?>
							</a>
							<br>
							<div style="color:rgb(150,150,150);margin-right:15px; float:right;text-decoration:none;font-size: 11px;"><?php echo $textviews ?> <?php echo $News['views']?> </div>                                                                       
						</div>
					</div>
					<?php }?>
		</div>
		<div style="clear:both"></div>
	</div>
	<div class="bottom_box"><span></span></div>
</div>
<?php } else { ?>
<link rel="stylesheet" type="text/css" href="/css/mostviewnews.css" />
				<div id="categories">
					<div class="c_navigator">
						<p class="navi_content"><?php echo $title;?> </p>
						<?php if(isset($login)&& $login =="1" && isset($permission) && $permission=="true")  {?>
						<!-- Tạo cây bút chì cho click and change -->
						<ul class="gallery clearfix">
							<a href="/lastestnews/clickchange?iframe=true&width=370&height=320" rel="prettyPhoto[iframe]">
								<img src="/images/Pencil.png" style="width:20px ; height:20px;margin-left:-25px; margin-top:10px;"></img>
							</a>
						</ul>
						<!-- End - Tạo cây bút chì cho click and change -->
						<?php  }?>
					</div> <!--end c_navigator-->
					<div class="most_view_content" style="margin-top:0px; padding: 0px">
						<div class="box_small_top" style="margin:0px; padding: 0px;height:10px"></div>
				        <div class="box_small_content " style="height:auto !important;z-index : 101;position:relative;">
				        <?php foreach ($AllNews as $News){ ?>
				        <div class="most_view_item" align="center" style="margin-left:10px">
		                    <div style="height:45px;width:55px;float:left" class="image" align="center">
		                    	<a href="/news/detail?id=<?php echo $News["thing_id"] ?>"><img width="55px" height="45px" onerror="this.src='/images/img_thumb.gif'" src="<?php if($News['avatar'] != null){echo $News['avatar'];}else{echo "/images/img_thumb.gif";}?>" />
		                    	</a>
		                    </div>
		                    <div class="new" >
		                    	<a style="font-size: 14px;" href="/news/detail?id=<?php echo $News["thing_id"] ?>">
		                    	<?php 
		                    	$kt=strlen($News['title']);
										if ($kt<=35)  
											echo $News['title']; 
										else 
											echo substr($News['title'], 0,35)."..";
											?></a>
											<br/>
											<div style="color:rgb(150,150,150); float:right;text-decoration:none;font-size: 11px;"><?php echo $textviews ?> <?php echo $News['views']?> </div>                                                                       
		                    </div>
		                </div>
						<?php }?>
				    	</div>
					    <div class="box_small_bottom" style="height:10px;background-position: bottom;"></div>
					</div>
				</div><!--end categories-->
				<div style="clear:both"></div>
<?php } ?>
	